package com.example.uwe.model;

import java.util.ArrayList;
import java.util.List;

public class Hall {
    private int id;
    private String name;
    private String phoneNumber;
    private String managerName;
    private List<Accommodation> accommodations;
    
    public Hall(int id, String name, String phoneNumber, String managerName) {
        this.id = id;
        this.name = name;
        this.phoneNumber = phoneNumber;
        this.managerName = managerName;
        this.accommodations = new ArrayList<>();
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getPhoneNumber() {
        return phoneNumber;
    }
    
    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }
    
    public String getManagerName() {
        return managerName;
    }
    
    public void setManagerName(String managerName) {
        this.managerName = managerName;
    }
    
    public List<Accommodation> getAccommodations() {
        return accommodations;
    }
    
    public void addAccommodation(Accommodation accommodation) {
        accommodations.add(accommodation);
    }
    
    public int getTotalAccommodations() {
        return accommodations.size();
    }
    
    public int getAvailableAccommodations() {
        return (int) accommodations.stream()
                .filter(a -> a.isAvailable() && a.getCleaningStatus() == CleaningStatus.CLEAN)
                .count();
    }
    
    public int getRequireCleaningAccommodations() {
        return (int) accommodations.stream()
                .filter(a -> a.getCleaningStatus() == CleaningStatus.DIRTY)
                .count();
    }
    
    public int getOfflineAccommodations() {
        return (int) accommodations.stream()
                .filter(a -> a.getCleaningStatus() == CleaningStatus.OFFLINE)
                .count();
    }
}